package com.zbkj.admin.controller.platform.brand;

import com.zbkj.common.page.CommonPage;
import com.zbkj.common.request.*;
import com.zbkj.common.response.*;
import com.zbkj.common.result.CommonResult;
import com.zbkj.service.service.AgentConfigService;
import com.zbkj.service.service.BrandAgentService;
import com.zbkj.service.service.UserAgentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 平台品牌商代理管理 前端控制器
 */
@Slf4j
@RestController
@RequestMapping("api/admin/platform/brand/agent")
@Api(tags = "平台品牌商代理管理") //配合swagger使用

public class PlatformBrandAgentController {

    @Autowired
    private BrandAgentService brandAgentService;

    /**
     * 分页显示品牌商代理设置表
     *
     * @param request          搜索条件
     * @param pageParamRequest 分页参数
     * @author dazongzi
     * @since 2025-07-01
     */
    //@PreAuthorize("hasAuthority('platform:activitystyle:list')")
    @ApiOperation(value = "分页列表") //配合swagger使用
    @RequestMapping(value = "/page/list", method = RequestMethod.GET)
    public CommonResult<CommonPage<PlatformBrandAgentPageDataResponse>> getPageList(@Validated BrandAgentSearchRequest request,
                                                                                    @ModelAttribute PageParamRequest pageParamRequest) {
        CommonPage<PlatformBrandAgentPageDataResponse> brandAgentConfigCommonPage = CommonPage.restPage(brandAgentService.getPageListPlatform(request, pageParamRequest));
        return CommonResult.success(brandAgentConfigCommonPage);
    }

}



